package gite.nouette.performance

import gite.nouette.performance.scenarii.GiteNouetteScenario
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
import java.util.Properties

class GiteNouetteSimulation extends Simulation {

  val (host, userNumber) = {
    val cfg = new Properties()
    cfg.load(getClass.getResourceAsStream("config.properties"))
    (
      cfg.getProperty("baseURL"),
      cfg.getProperty("userNumber").toInt
      )
  }

  val httpProtocol = http.baseURL(host).disableFollowRedirect
  setUp(
    GiteNouetteScenario.scn("/fr").inject(ramp(userNumber users) over (1 seconds))
  ).protocols(httpProtocol)
}
